package Server.Poker.ZJH10;

import java.util.Random;

public class Constants {
	// 扑克类型
	public static int CT_SINGLE = 1; // 单牌类型
	public static int CT_DOUBLE = 2; // 对子类型
	public static int CT_SHUN_ZI = 3; // 顺子类型
	public static int CT_JIN_HUA = 4; // 金花类型
	public static int CT_SHUN_JIN = 5; // 顺金类型
	public static int CT_BAO_ZI = 6; // 豹子类型
	public static int CT_SPECIAL = 7; // 特殊类型
	
	public static int INVALID_CARD = 255;
	
	public static int INVALID_CHAIR = 255;	
	//游戏状态
	public static int GS_FREE			=			0;								//空闲状态
	public static int GS_PLAYING		=			100;								//游戏状态
	
	//结束原因
	public static int GER_NORMAL		=			0x00	;							//常规结束
	public static int GER_DISMISS		=			0x01	;							//游戏解散
	public static int GER_USER_LEFT		=			0x02	;							//用户离开	
	public static int GER_NO_PLAYER = 0x10; // 没有玩家
	public static int CS_NULL = 0;
	public static int CS_ANPAI = 1;
	public static int CS_KANPAI = 2;
	public static int CS_QIPAI = 3;
	public static int CS_ANPAI_LOSE = 5;
	public static int CS_MINGPAI_LOSE = 6;
	public static int US_FREE			=			0x10	;							//站立状态 
	public static int US_SIT			=			0x11	;							//坐下状态 
	public static int US_LOOKON			=			0x12	;							//旁观状态 
	public static int US_OFFLINE		=			0x13	;							//断线状态 		
	
	public static int atoi(String string) {
		try {
			return Integer.parseInt(string);
		} catch (Exception e) {

		}
		return 0;
	}
	public static Random rd = new Random();
	
	public static void memcpy(int[] by, int[] by2, int length) {
		for (int i = 0; i < length; i++) {
			by[i] = by2[i];
		}
	}
	public static final int rand() {
		return rd.nextInt(1000);
	}

	public static int rand(int i, int j) {
		return  rand(i,j,0);
	}
	public static final int rand(int i, int j, int factor) {
		return rd.nextInt(j - i) + i;
	}
}
